#ifndef SHOPTREEMODEL_H
#define SHOPTREEMODEL_H

#include <QStandardItemModel>
#include <QModelIndex>

#include "Shop.h"

class ShopTreeModel : public QStandardItemModel
{
    Q_OBJECT

public:

    enum COLUMNS_CUSTOMER
    {
        CUSTOMER_NAME       = 0
    };

    enum COLUMNS_INVOICE
    {
        INVOICE_DATE        = 0,
        INVOICE_TOTAL       = 1,
        INVOICE_PROFIT      = 2
    };

    enum COLUMNS_INVOICE_ITEMS
    {
        ITEM_DESCRIPTION    = 0,
        ITEM_TOTAL          = 1
    };


    ShopTreeModel( const ecocity::Shop& shop,
                   QObject *parent = 0 );

    Qt::ItemFlags flags( const QModelIndex &index ) const;

    const ecocity::Invoice* invoice( const QModelIndex& index ) const;

    void reset( const ecocity::Shop& shop );

private:

    ecocity::Shop m_shop;
};


#endif // SHOPTREEMODEL_H
